﻿@{
    ViewBag.Title = "投诉表扬列表";
    Layout = "~/Views/Shared/WeixinApp/_Index.cshtml";
}

<header>
    @*<h1 class="header-title">客户产品</h1>*@
    <div class="search-middle-brief" style="margin-left: 8px;margin-top: 4px;margin-right: 10px;background-color: #fff;">
        <div class="searchInput">
            <input class="search" type="search" id="searchInput" maxlength="32" placeholder="标题、内容" autocomplete="off" autocorrect="off" autocapitalize="off" value="">
            <i class="iconwst iconwst-input-cross" style="padding-right: 6px"></i>
        </div>
        <button type="submit" class="button" id="searchbtn">
            <i class="weui-icon-search"></i>
        </button>
    </div>
</header>

<div class="weui-cells" style="margin-top:0;" id="dataList">

</div>

<div class="weui-footer">
    <p class="weui-footer__text"></p>
</div>

<script>
    $(function () {
        FastClick.attach(document.body);
    });
</script>
<script src="~/Content/weui/js/jquery-weui.min.js"></script>
<script src="~/Content/weui/js/weui.min.js"></script>
<script src="~/Content/weui/js/weui.expand.js?t=2"></script>
<script>
    var detailData = [];
    var openid = $.cookie('openid');
    var customerId = $.getQueryString("customerId");
    $(document).ready(function () {
        getDataList(customerId);
    });

    $("#searchbtn").bind("click", function () {
        getDataList();
    });
    $('#searchInput').bind('keypress', function (event) {
        if (event.keyCode == "13") {
            getDataList();
            return false;
        }
    });

    function getDataList() {
        var req = {
            keyword: $("#searchInput").val()
        };
        $.ajaxGet({
            data: req,
            url: '/WeixinApp/Complaints/GetListJson',
            success: function (oObject) {
                if (oObject.state != "success") {
                    $.toptip(oObject.message, 'warning');
                    return false;
                }
                var htm = template("dataList_template", oObject.res);
                $("#dataList").html(htm);
                $(".weui-cell_access").click(function () {
                    var keyValue = $(this).attr("data-id");
                    $.redirectTo("/WeixinApp/Complaints/Details", customerId, keyValue);
                });
            }
        })
    }
   
</script>

<script id="dataList_template" type="text/html">
    {{ each data as value index }}
    <a class="weui-cell weui-cell_access" href="javascript:void(0);" data-id="{{value.T_Id}}">
        <div class="weui-cell__bd">
            <h4 class="weui-media-box__title">{{value.T_Title}}</h4>
            <p class="weui-media-box__desc"><span>{{value.T_Type}}：{{value.T_Respondent}}</span><span class="desc_padding">{{value.T_CreateTime}}</span></p>
        </div>
        <div class="weui-cell__ft "><span class="label {{if value.T_State==1 }}label-default{{else}}label-warn{{/if}}">{{if value.T_State }}已处理{{else}}未处理{{/if}}</span></div>
    </a>
    {{ /each }}
</script>


